//
//  DetailViewController.m
//  parent
//
//  Created by yanzhen on 15/7/19.
//  Copyright (c) 2015年 ci123. All rights reserved.
//

#import "DetailViewController.h"
#import "RuleViewController.h"
#import "AFAppClient.h"
@interface DetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *content;

@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"信件详情";
    [self CustomBackButton];
    self.did = 1;
    [self initData];
}
-(void)initData
{
    [self showHud:kLoadingData isDim:YES];
    [ [AFAppClient sharedManager]getWithURL:[NSString stringWithFormat:@"%@%@",SERVER_URL_NEW,kGetMailDetail] withParameters:@{@"id":@(_did) }success:^(NSDictionary *responseObject) {
        NSUInteger code = [[responseObject objectForKey:@"code"]integerValue];
        if(code>0){
            [self hideHud2];
            NSDictionary *result = [responseObject objectForKey:@"result"];
            _content.text = [result objectForKey:@"content"];
        }else{
            [self showHudComplete:@"信件不存在" success:NO];
        }
    } failure:^(NSError *error) {
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)rule:(id)sender {
    RuleViewController *rule = [[RuleViewController alloc]init];
    rule.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:rule animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
